package cn.hxzy.servlet.admin;

import cn.hxzy.service.WorkService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/admin/addWork")
public class AddWorkServlet extends HttpServlet {
    WorkService workService=new WorkService();
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        List all = null;
        try {
            all = workService.findAll();
            req.setAttribute("addWork", all);
            req.getRequestDispatcher("/WEB-INF/jsp/admin/addWork.jsp").forward(req, resp);
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}
